<script  runat="server">
function getBrowse(ByVal selecttype As String , ByVal id As String,ByVal lcConn As String ) As String
	Dim strBrowse As String=""
	select case selecttype
	   case "subject"
		strBrowse="Select * from vwSubjectClassese "
		strBrowse +=  " where ClassID='"
	   case "classese"
		strBrowse="Select * from vwSubjectClassese "
		strBrowse +=  " where SubjectID='"
	   case "groups"
		strBrowse="Select * from vwClasseseGroups  "
		strBrowse +=  " where ClassID='"
	   case "category"
		strBrowse="Select * from vwGroupsCategory  "
		strBrowse +=  " where GroupID='"
	   case "subcategory"
		strBrowse="Select * from vwCategorySubcategory  "
		strBrowse +=  " where CateID='"
	   case else
		strBrowse="Select * from vwCategorySubcategory "
		strBrowse +=  " where SubCateID='"
	end select
	strBrowse +=  id & "'"	
Try
	Dim myConn As SqlConnection  = _
	New SqlConnection(lcConn)
	myConn.Open		
	Dim myCom As SqlCommand = _
	New SqlCommand(strBrowse,myConn)
	Dim myReader As SqlDataReader = _
	myCom.ExecuteReader()
	strBrowse=""
    	While myReader.Read()
	      select case selecttype
		case "groups"
			strBrowse="<a href=browsesubject.aspx?type=classese"
			strBrowse +=  "&id=" & myReader("SubjectID").toString() & ">"			
			strBrowse += myReader("SubjectName").toString()
			strBrowse +=  "</a> &nbsp;> "							
			strBrowse += myReader("className").toString() & " &nbsp; "
		case "category"
			strBrowse="<a href=browsesubject.aspx?type=classese"
			strBrowse +=  "&id=" & myReader("subjectid").toString() & ">"
			strBrowse +=  myReader("subjectName").toString()
			strBrowse +=  "</a> &nbsp;> "
			strBrowse +=  "<a href=browsesubject.aspx?"
			strBrowse +=  "type=groups"
			strBrowse +=  "&id=" & myReader("classid").toString() & ">"
			strBrowse +=  myReader("ClassName").toString()
			strBrowse +=  "</a> &nbsp;> "			
			strBrowse +=  myReader("GroupName").toString() & " &nbsp; "
		case "subcategory"
			strBrowse="<a href=browsesubject.aspx?type=classese"
			strBrowse +=  "&id=" & myReader("subjectid").toString() & ">"
			strBrowse += myReader("subjectName").toString() 
			strBrowse +=  "</a> &nbsp;> "
			strBrowse +=  "<a href=browsesubject.aspx?"
			strBrowse +=  "type=groups"
			strBrowse +=  "&id=" & myReader("classid").toString() & ">"
			strBrowse += myReader("className").toString() 
			strBrowse +=  "</a> &nbsp;> "
			strBrowse +=  "<a href=browsesubject.aspx?"
			strBrowse +=  "type=category"
			strBrowse +=  "&id=" & myReader("groupid").toString() & ">"
			strBrowse += myReader("groupName").toString() 
			strBrowse +=  "</a> &nbsp;> "			
			strBrowse += myReader("cateName").toString()		
		End Select	     
	End While	
	myReader.Close
	myConn.Close
Catch objError As Exception
	strBrowse= "<b>* Error</b>: " & _
	objError.Message & "<p />"
End Try
getBrowse =strBrowse 
End Function
</script>